import request from "@/util/request";

export function getTopGame() {
    return request({
        url: '/boxGame/getTopGame',
        method: 'get'
    })
}

export function uploadTopGameImg(data) {
    return request({
        url: '/boxGame/uploadTopGameImg',
        method: 'post',
        data: data,
        headers: {
            'Content-type': 'multipart/form-data'
        }
    })
}

export function pageGame(param) {
    return request({
        url: '/boxGame/page',
        method: 'get',
        params: param
    })
}

export function deleteGame(gameId) {
    return request({
        url: '/boxGame/deleteGame',
        method: 'delete',
        params: {
            gameId: gameId
        }
    })
}

export function getById(id) {
    return request({
        url: '/boxGame/getById',
        method: 'get',
        params: {
            id: id
        }
    })
}

export function saveOrUpdate(data) {
    return request({
        url: '/boxGame/saveOrUpdate',
        method: 'post',
        data: data
    })
}

export function uploadGameDetailImg(data) {
    return request({
        url: '/boxGame/uploadGameDetailImg',
        method: 'post',
        data: data,
        headers: {
            'Content-type': 'multipart/form-data'
        }
    })
}

export function uploadGameCoverImg(data) {
    return request({
        url: '/boxGame/uploadGameImg',
        method: 'post',
        data: data,
        headers: {
            'Content-type': 'multipart/form-data'
        }
    })
}

export function uploadGameRecommendImg(data) {
    return request({
        url: '/boxGame/uploadRecommendImg',
        method: 'post',
        data: data,
        headers: {
            'Content-type': 'multipart/form-data'
        }
    })
}

export function listRecommendGame() {
    return request({
        url: '/boxGame/listRecommendGame',
        method: 'get'
    })
}

export function listGame() {
    return request({
        url: '/boxGame/list',
        method: 'get',
    })
}
